package kr.hkit.powerjava.chapter07.Programming;

public class Rectangle {

	private double w, h;

	public Rectangle() {
		w = 0;
		h = 0;
	}

	public Rectangle(double w, double h) {
		super();
		this.w = w;
		this.h = h;
	}

	public double getW() {
		return w;
	}

	public void setW(double w) {
		this.w = w;
	}

	public double getH() {
		return h;
	}

	public void setH(double h) {
		this.h = h;
	}

	double area() {
		return w * h;
	}

	double perimeter() {
		return 2 * (w + h);
	}

	@Override
	public String toString() {
		return "w=" + w + ", h=" + h + ", area()=" + area()
				+ ", perimeter()=" + perimeter();
	}
}
